import sys

for line in sys.stdin:
    a = int(line.rstrip())
    l = list(map(int, input().split()))
    ans = []
    for i in range(2,len(l)-1):
        if l[i-1]<l[i] and l[i]>l[i+1]:
            ans.append(i)
        elif l[i-1]>l[i] and l[i]<l[i+1]:
            ans.append(i)
    print(" ".join(map(str,ans)))